// Clase que define un vector

#ifndef VECTOR3_H_
#define VECTOR3_H_

class Vector3
{
private:
	float mData[3];

public:
	Vector3();
	Vector3(float x, float y, float z);
	Vector3(const Vector3& vector);

	~Vector3();

	float X () const{ return mData[0]; }
	float& X() { return mData[0]; }

	float Y() const { return mData[1]; }
	float& Y() { return mData[1]; }

	float Z() const { return mData[2]; }
	float& Z() { return mData[2]; } 

	void CopyData(const float x, const float y, const float z);
	void CopyData(const Vector3& v);
	void ScaleData(const float sx, const float sy, const float sz);
	float*  GetData() { return mData; }

	void Normalize();
	float Length();
	float SqrLength();
	float Dot(const Vector3& vect);
	void Cross(const Vector3& vect);

	void Add(const Vector3& vect);
	void Sub(const Vector3& vect);
	void Scale( const float val );
	void Div( const float val );

	static void Length( const Vector3& vect, float * length );
	static void SqrLength( const Vector3& vect, float * sqrLength );
	static void Normalize( const Vector3& vect, Vector3* result );

	static void Dot(const Vector3& v1, const Vector3& v2, float * val);
	static void Cross(const Vector3& v1, const Vector3& v2, Vector3* val);

	static void Add(const Vector3& v1, const Vector3& v2, Vector3 * val);
	static void Sub(const Vector3& v1, const Vector3& v2, Vector3 * val);
	static void Scale(const Vector3& v1, const float num, Vector3 * val);
	static void Div(const Vector3& v1, const float num, Vector3 * val);
};

#endif // VECTOR3_H_